﻿Imports System.Data.SQLite

Public Class Principal
    Private MiBd As BD
    Private MiConfiguracion As Configuracion

    Private Sub SalirToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SalirToolStripMenuItem.Click
        Me.Close()


    End Sub

    Private Sub AltaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AltaToolStripMenuItem.Click
        Dim altaCliente As New AltaCliente()
        altaCliente.Show()




    End Sub

    Private Sub ParámetrosGlobalesToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ParámetrosGlobalesToolStripMenuItem.Click
        Dim parametros As New ParametrosForm()
        parametros.Show()
    End Sub

    Private Sub Principal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        MiConfiguracion = New Configuracion()
        MiBd = New BD()
        MiBd.Conectar()

    End Sub

    Public ReadOnly Property Bd As BD
        Get
            Return MiBd
        End Get

    End Property

    Public ReadOnly Property Configuracion As Configuracion
        Get
            Return MiConfiguracion
        End Get
    End Property



    Private Sub Principal_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
        Bd.Cerrar()
    End Sub

    Private Sub NuevaPuntualToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NuevaPuntualToolStripMenuItem.Click
        Dim MiFormReserva As New ReservaPuntual()
        MiFormReserva.Show()
    End Sub

    Private Sub FichaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FichaToolStripMenuItem.Click
        Dim MiFormFicha As New FichaCliente()
        MiFormFicha.Show()

    End Sub


    Private Sub RealizarCopiaDeSeguridadToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RealizarCopiaDeSeguridadToolStripMenuItem.Click
        Bd.Backup()

    End Sub

    Private Sub RestaurarCopiaDeSeguridadToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RestaurarCopiaDeSeguridadToolStripMenuItem.Click
        Bd.Restore()
    End Sub
End Class
